<#import "/admin/_layout.html" as layout>
<@layout.header "岗位"></@layout.header>
<@layout.body>
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-left">
                        <li class="breadcrumb-item"><a href="#">岗位</a></li>
                        <li class="breadcrumb-item active">新增</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <section class="content">
        <div class="container-fluid">
            <div class="card card-default">
                <form id="myForm" method="POST" action="/admin/user/station/doSave" ok="/admin/user/station/list">
                    <input type="hidden" name="id" value="${(station.id)!}">
                    <div class="card-body">
                        <div class="form-group">
                            <label for="stationName">岗位名称</label>
                            <input type="text" name="stationName" class="form-control" id="stationName" placeholder="请输入岗位名称" value="${(station.stationName)!}">
                        </div>
                        <div class="form-group">
                            <label for="stationDesc">描述</label>
                            <input type="text" name="stationDesc" class="form-control" id="stationDesc" placeholder="请输入岗位描述" value="${(station.stationDesc)!}">
                        </div>
                        <div class="form-group">
                            <label for="withManager">是否管理岗</label>
                            <input type="checkbox" class="switchery" data-for="withManager" <@checkedIf value=(station?? && station.withManager)/>>
                            <input type="hidden" id="withManager" name="withManager">
                        </div>
                        <div class="form-group">
                            <#assign _status=(station.status)!1 />
                            <label for="status_sel">状态</label>
                            <select class="form-control" id="status" name="status">
                                <option value="1" <@selectedIf value=(_status ==1)/>>正常使用</option>
                                <option value="0" <@selectedIf value=(_status ==0)/>>删除</option>
                            </select>
                        </div>
                    </div>
                    <div class="card-footer">
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </section>
</@layout.body>
<@layout.script>
    <script>
        $(function () {
            submitForm({
                title: { required: true}
            },{
                title: {required: "请输入岗位名称"}
            })
        });
    </script>
</@layout.script>